package com.example.project3.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.example.project3.entity.User;
import com.example.project3.exception.ServiceException;

/**
 * @author 23931
 * @description 针对表【user】的数据库操作Service
 * @createDate 2023-05-29 19:20:56
 */
public interface UserService extends IService<User> {

    /**
     * 通过email发送邮箱验证码
     *
     * @param email
     * @return
     */
    void sendCode(String email) throws ServiceException;

    /**
     * 验证邮箱验证码
     *
     * @param email
     * @param code
     * @return
     */
    boolean verifyCode(String email, String code);

    boolean register(User user);

    String login(User user) throws ServiceException;

    void updateUsername(User user);
}
